<?php

namespace app\common\validate\Post;

use think\Validate;

class Post extends Validate
{
  protected $rule = [
    'title'   => ['require'],
    'content'   => ['require'],
    'point' => ['require', 'number'],
    'cateid' => ['require', 'number'],
  ];

  protected $message = [
    'title.require' => '标题不能为空',
    'content.require' => '内容不能为空',
    'point.require' => '积分不能为空',
    'point.number' => '积分必须为数字',
    'cateid.require' => '分类不能为空',
    'cateid.number' => '分类必须为数字',
  ];

  // 场景
  protected $scene = [
    'add' => ['title', 'content', 'point', 'cateid'],
  ];
}
